package com.school.manager.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.school.manager.domaim.SysCodeBook;
import com.school.manager.entity.po.SysCodeBookPo;
import com.school.manager.entity.vo.SysCodeBookVo;
import com.school.manager.mapper.SysCodeBookMapper;
import com.school.manager.service.ISysCodeBookService;
import com.school.manager.utils.PageUtil;

import lombok.extern.slf4j.Slf4j;

/**
 * description：系统字典业务实现类
 * date：2021/10/133:18 下午
 */

@Service
@Slf4j
public class SysCodeBookServiceImpl extends ServiceImpl<SysCodeBookMapper, SysCodeBook> implements ISysCodeBookService {
	
	@Autowired
    private SysCodeBookMapper sysCodeBookMapper;
	
	@Override
	public Page<SysCodeBookVo> page(SysCodeBookPo sysCodeBookPo) {
		QueryWrapper<SysCodeBook> queryWrapper = PageUtil.buildQueryWrapper(sysCodeBookPo, SysCodeBook.class);
        Page<SysCodeBook> page = new Page<>(sysCodeBookPo.getCurrent(), sysCodeBookPo.getSize());
        sysCodeBookMapper.selectPage(page, queryWrapper);
        return PageUtil.buildPage(page, SysCodeBookVo.class);
	}
	
	

}
